import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';

import 'Meow.dart';
import 'Player.dart';

class Item extends StatelessWidget {

  final Meow meow;
  const Item({ Key key , this.meow }) : super(key: key);

  void playMp3() {
    Player.play(this.meow.mp3);
  }

  @override
  Widget build(BuildContext context) {
    return Card(
      child: InkWell(
        splashColor: Colors.blue.withAlpha(30),
        onTap: () {
          playMp3();
        },
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // CachedNetworkImage(
            //     imageUrl: "",
            //     placeholder: (context, url) => CircularProgressIndicator(),
            //     errorWidget: (context, url, error) => Icon(Icons.error),
            // ),
            Text(this.meow.title)
          ],
        ),
      ),
    );
  }
}